package com.jthinker.bean.enu;

import org.apache.commons.lang3.StringUtils;

/**
 * User: Gang Chen grater
 * Date: 2015/3/23 21:38
 */
public enum Operator
{
    EQUAL, LIKE, LESS, GREAT, LESS_OR_EQUAL, GREAT_OR_REQUAL, IN, NOT_IN;

    public static final Operator parse(String raw)
    {
        if (StringUtils.isBlank(raw))
        {
            return EQUAL;
        }

        for (Operator op : Operator.values())
        {
            if (op.toString().equalsIgnoreCase(raw))
            {
                return op;
            }

        }
        return EQUAL;
    }

}
